<template >
    <el-menu
            style="width: 200px;min-height: calc(100vh - 50px);background:linear-gradient(0deg,#1deca4,#61b9dc)"
            :uniqueOpened="true"
            default-active="/news"
            class="el-menu-vertical-demo"
            router
            background-color="inherit"
            text-color="#fff"
            active-text-color="#ffd04b">
        <el-sub-menu  >
            <template #title>
                <el-icon><location /></el-icon>
                <span>系统管理</span>
            </template>
                <el-menu-item v-for="(item,index) in treeData" :key="index" :index=item.menuUrl>{{item.menuName}}</el-menu-item>
        </el-sub-menu>
    </el-menu>
</template>
<script>

    export default {
        // eslint-disable-next-line vue/multi-word-component-names
        name: "Aside",
        data(){
            return{
                treeData:[],
                user:{},
            }
        },
        created(){
            // this.load();
        },
        mounted(){
            this.load();
        },
        methods:{
            load(){
                this.$http.get("/menu/menuAll").then((response) =>
                {
                    if (response.status =='200' && response.data.data.length>0){
                        this.treeData = response.data.data;
                        console.log(this.treeData)

                    }
                    console.log(response);
                })
            },
        }
    }
</script>

<style scoped>

</style>